package main.java.view;

import java.awt.Color;
import java.awt.GridLayout;

import javax.swing.JFrame;

public class MainFrame extends JFrame {
    
    //Type of set
    private static final String [] SETS = {"FRONT", "LEFT", "RIGHT"}; 
    
    //static final variables to change positions id easier
    private static final int GRID1 = 2;
    private static final int GRID2 = 2;
    
    private PilotMainView pilotMainView;
    private BlocView [] blocView;

    /**
     * Constructor MainFrame
     */
    public MainFrame() {
        //Initialize frame info
        this.setTitle("Welcome aboard!");
        this.setLayout(new GridLayout(GRID1, GRID2));
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(false);
        this.getContentPane().setBackground(Color.white);
        
        //Instantiation of the views
        blocView = new BlocView[SETS.length];
        pilotMainView = new PilotMainView();
        
        this.getContentPane().add(pilotMainView);
        
        //Instantiation of blocs views
        for (int i = 0; i < SETS.length; i++) {
            blocView[i] = new BlocView(SETS[i]);
            this.getContentPane().add(blocView[i]);
        }
        
        //Pack the view
        this.pack();
    }

    public PilotMainView getPilotMainView() {
		return pilotMainView;
	}


	public void setPilotMainView(PilotMainView pilotMainView) {
		this.pilotMainView = pilotMainView;
	}

	public BlocView[] getBlocView() {
        return blocView;
    }

    public void setBlocView(BlocView [] blocView) {
        this.blocView = blocView;
    }

}
